<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<% String context = request.getContextPath();
	session.setAttribute("context", context);
%>
<script type="text/javascript" src="${context}/plugins/jQuery/jQuery-2.1.4.min.js"></script>
<script type="text/javascript" src="${context}/plugins/vue/vue.min.js"></script>
<script type="text/javascript" src="${context}/plugins/vue/vue-resource.min.js"></script>

</head>
<body>
 <div id="demoapp">
<p>{{demoObj.demoId}}</p>
<p>{{demoObj.userName}}</p>
<p>{{demoObj.passWord}}</p>
 
  <button v-on:click="getTest()">getTest() </button>
<p>{{demoObj}}</p>


 </div>
 
<script type="text/javascript">

var app = new Vue({
    el: '#demoapp',
    data:{
    	context:'${context}',
    	resultObj:{},
    	demoObj:{
    		demoId:43,
			userName:"zs",
			passWord:"12345"
    	}
    },
    created: function () {
        console.log('name is: ' + this.name)
        console.log('name is: ' + this.context)
    },
    computed:{
    	
    },methods:{
    	getTest: function () {
    		
    		 Vue.http({
    		        method: 'POST',
    		        url:this.context + "/demo/list",
    		        params: this.demoObj,
    		        emulateJSON: true
    		      }).then(function (response) {
    		          console.log(response.data);
    		          
    		         
    		        }, function (error) {
    		          console.log(error)
    		        })
        }
    }
});
</script>
</body>
</html>
